<{$xoTheme->addStylesheet("modules/`$xoops_dirname`/templates/style.css")}>
<div id="support_index_crumb" class="breadcrumbs">
    <{foreach item=itm from=$xoBreadcrumbs name=bcloop}>
       
        <{if $itm.link}>
            <a href="<{$itm.link}>" title="<{$itm.title}>"><{$itm.title}></a>
        <{else}>
            <{$itm.title}>
        <{/if}>
        <{if !$smarty.foreach.bcloop.last}>
            &raquo;
        <{/if}>
    <{/foreach}>
</div>

<{if $user.level eq 'customer'}><div><a href="index.php?op=add"><{$smarty.const._MA_SUPPORT_ASK}></a></div><{/if}>
<{include file="db:support_manager.html"}>

<div class="support_search">
    <form name="search" method="post" action="index.php">
        <{$smarty.const._MA_SUPPORT_SEARCH}>:
        <select name="select">
            <{foreach item=item key=key from=$list}>
                <option value="<{$key}>" <{if $key eq $select}>selected="selected"<{/if}>><{$item}></option>
            <{/foreach}> 
        </select>
        <input type="text" name="keyword" size="30" maxlength="255" tabindex="1" />
        <input type="submit" value="<{$smarty.const._MA_SUPPORT_QUERY}>" tabindex="2" />
    </form>
</div>

<table class="outer" align="left" id="support-info-table"> 
    <th width="20%">&nbsp;</th>
    <th width="80%"><{$process.subject}></th>
    <tr class="<{cycle values='odd, even'}>" align="center">
        <td>
            <ul id="support-info">
                <li><{$smarty.const._MA_SUPPORT_CREATOR}>:<{if $process.customer_name}><{$process.customer_name}><{else}><{$process.customer_uname}><{/if}></li>
                <li><{$smarty.const._MA_SUPPORT_QUESTIONCAT}>:<{if $process.category}><{$process.category}><{else}><{$smarty.const._MA_SUPPORT_DEFAULTCAT}><{/if}></li>
                <li><{$smarty.const._MA_SUPPORT_CURRENTSTATUS}>:<{$process.action}></li>
                <li><{$smarty.const._MA_SUPPORT_PUBDATE}>:<{$process.create_time}></li>
                <{if $process.last_reply_time}><li><{$smarty.const._MA_SUPPORT_ENDDATE}>:<{$process.last_reply_time}></li><{/if}>
                <li><{$smarty.const._MA_SUPPORT_SUPPORT}>:<{if $process.support_id}><{if $process.support_name}><{$process.support_name}><{else}><{$process.support_uname}><{/if}><{else}><{$smarty.const._MA_SUPPORT_CLAIM}><{/if}></li>
            </ul>
        </td>
        <td align="left">
            <{$process.infomation}>
            <{if $process.files}>
                <div><{$smarty.const._MA_SUPPORT_ANNEX}>：
                <{foreach item=annex from=$process.files}>
                    <a href="downloads.php?annex_id=<{$annex.annex_id}>"><{$annex.annex_title}></a>&nbsp;&nbsp;&nbsp;&nbsp;
                <{/foreach}>
                </div>
            <{/if}>
        </td>
    </tr>
</table>
<br style="clear: both;"/>

<{if $tranforms}>
    <{foreach item=tranform from=$tranforms}>
        <table class="outer" align="left" id="support-info-table"> 
            <th width="20%">&nbsp;</th>
            <th width="80%"><{$smarty.const._MA_SUPPORT_REPLAY}>：<{$process.subject}></th>
            <tr class="<{cycle values='odd, even'}>" align="center">
                <td>
                    <ul id="support-info">
                        <li><{if $tranform.role eq 'support_manager'}><{$smarty.const._MA_SUPPORT_MANGER}><{elseif $tranform.role eq 'support'}><{$smarty.const._MA_SUPPORT_SUPPORT}><{elseif $tranform.role eq 'customer'}>提交者<{/if}>:<{if $tranform.name}><{$tranform.name}><{else}><{$tranform.uname}><{/if}></li>
                        <li><{$smarty.const._MA_SUPPORT_TIME}>:<{$tranform.create_time}></li>
                        <li><{$smarty.const._MA_SUPPORT_ACTIVE}>:<{$tranform.status}></li>
                    </ul>
                </td>
                <td align="left">
                <{if $tranform.tran_desc}><{$tranform.tran_desc}><{else}><{$tranform.status_info}><{/if}>
                <{if $tranform.files}>
                    <div><{$smarty.const._MA_SUPPORT_ANNEX}>：
                    <{foreach item=file from=$tranform.files}>
                        <a href="downloads.php?annex_id=<{$file.annex_id}>"><{$file.annex_title}></a>&nbsp;&nbsp;&nbsp;&nbsp;
                    <{/foreach}>
                    </div>
                <{/if}>
                </td>
            </tr>
        </table>
        <br style="clear: both;"/>
    <{/foreach}>
<{/if}>
<br style="clear: both;"/>

<div id="support-info-sub" align="center"> 
<input type="submit" value="<{$smarty.const._MA_SUPPORT_DOREAD}>" tabindex="2" id="read" onClick="redirect('read');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_REPLAY}>" tabindex="2" id="<{if $user.level eq 'customer'}>reject<{else}>reply<{/if}>" onClick="redirect('<{if $user.level eq 'customer'}>reject<{else}>reply<{/if}>');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_FORWARD}>" tabindex="2" id="forword" onClick="redirect('forword');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_DONE}>" tabindex="2" id="finish" onClick="redirect('finish');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_IGNORE}>" tabindex="2" id="lgnore" onClick="redirect('lgnore');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_CLOSE}>" tabindex="2" id="close" onClick="redirect('close');" />
<input type="submit" value="<{$smarty.const._MA_SUPPORT_BACK}>" tabindex="2" id="redirect" onClick="redirect();" />
</div>

<script>
<{if $process.usesub}>
<{foreach item=usesub from=$process.usesub}>
    document.getElementById('<{$usesub}>').disabled = true;
<{/foreach}>
<{/if}>

function redirect(page){
    var redirect;
    if(page == "read"){
        redirect = "action.php?pro_id=<{$process.pro_id}>&op=read";
    }else if(page == "reply"){
        redirect = "info.php?pro_id=<{$process.pro_id}>&op=reply";
    }else if(page == "reject"){
        redirect = "info.php?pro_id=<{$process.pro_id}>&op=reject";
    }else if(page == "forword"){
        redirect = "info.php?pro_id=<{$process.pro_id}>&op=forword";
    }else if(page == "finish"){
        redirect = "action.php?pro_id=<{$process.pro_id}>&op=finish";
    }else if(page == "lgnore"){
        redirect = "action.php?pro_id=<{$process.pro_id}>&op=lgnore";
    }else if(page == "close"){
        redirect = "action.php?pro_id=<{$process.pro_id}>&op=close";
    }else{
        redirect= "index.php";
    }
    window.location.href=redirect
}
</script>
